package jp.sinya.reflect;

import org.apache.commons.beanutils.BeanUtils;
import org.junit.Test;

public class ReflectDemo {

    @Test
    public void test() throws Exception {
        String className = "jp.sinya.reflect.Person";
        Class clazz = Class.forName(className);
        Object obj = clazz.newInstance();

        BeanUtils.setProperty(obj, "name", "sinya");
        BeanUtils.setProperty(obj, "age", 21);

        System.out.println(obj.toString());
    }
}
